<template>
  <div class="shop__item" @click="handleClick(item._id)">
    <img :src="item.img" alt="" class="shop__item__img">
    <div class="shop__content">
      <div class="shop__content__title">{{ item.title }}</div>
      <div class="shop__content__tags">
        <span class="shop__content__tag" v-for="tag in item.tags" :key="tag">{{ tag }}</span>
      </div>
      <p class="shop__content__highlight">{{ item.highlight }}</p>
    </div>
  </div>
</template>

<script setup>
import { } from "vue"
import { useRouter } from 'vue-router'
defineProps({
  item: {}
})
const router = useRouter()
const handleClick = (id) => {
  router.push({
    name: 'Shop',
    params: {
      id
    }
  })
}
</script>

<style lang="scss" scoped>
@import '@/css/variables.scss';
@import '@/css/mixins.scss';

.shop {
  &__item {
    display: flex;
    padding-top: 0.12rem;

    &__img {
      width: 0.56rem;
      height: 0.56rem;
      margin-right: 0.16rem;
    }
  }

  &__content {
    flex: 1;
    padding-bottom: 1px solid $content-bgColor;
    border-bottom: 1px solid $content-bgColor;

    &__title {
      line-height: 0.22rem;
      font-size: .16rem;
      color: $content-fontColor;
    }

    &__tags {
      margin-top: 0.08rem;
      line-height: 0.18rem;
      font-size: 0.13rem;
      color: $content-fontColor;
    }

    &__tag {
      margin-right: 0.16rem;
    }

    &__highlight {
      margin: 0.08rem 0 0 0;
      line-height: 0.18rem;
      font-size: 0.13rem;
      color: $highlight-fontColor;
    }
  }
}
</style>
